<template>
<div>
  <h1>peronal page</h1>
  <h2>hello , {{user}}</h2>
  <el-table
    :data="personInfo"
    style="width: 50%">
    <el-table-column
      prop="nickname"
      label="昵称"
      width="180">
    </el-table-column>
    <el-table-column
      prop="sex"
      label="性别"
      width="180">
    </el-table-column>
    <el-table-column
      prop="id"
      label="编号">
    </el-table-column>
  </el-table>
</div>

</template>

<script>
export default {
  data () {
    return {
      personInfo:[]
    };
  },
  created(){
    this.getPersonInfo();
  },
  computed: {
    user(){
      return sessionStorage.getItem('loginUser');
    }
  },
  methods:{
    getPersonInfo(){
      let that = this;
      axios.get('/user/getAllUser').then(function(res) {
        if(res.data.code === 200){
          that.personInfo = res.data.data;
        }else{
          that.$message.error("no data !" + res.data);
        }
      })
    }
  }

}
</script>

<style scoped>

</style>